package com.qf.mq.listener;

import com.qf.service.DataFilterManager;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;

import com.qianfeng.smsplatform.common.model.Standard_Submit;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/*
 * @Data: 2021/7/14 21:08
 * */
@Component
public class PreQueueRabbitListener {

    private DataFilterManager dataFilterManager;
    @Autowired
    public void setDataFilterManager(DataFilterManager dataFilterManager) {
        this.dataFilterManager = dataFilterManager;
    }

    @RabbitListener(queues =RabbitMqConsants.TOPIC_PRE_SEND)
    public void onMessage(Standard_Submit standard_submit){


        try {
            dataFilterManager.dealSms(standard_submit);
            System.out.println("来监听了");
        } catch (Exception e) {
            e.printStackTrace();
        }
//        TODO 处理异常即可


    }
}
